const express=require("express")
const app=express()
app.set('secret','1asdasxazasd')//表示在当前express实例上面设置一个变量，这个值按道理应该放在环境变量里面，为了简单就放这里

app.listen(3000,()=>{
    console.log('http://localhost:3000')
});

app.use(require('cors')())
app.use(express.json())
//托管静态文件
app.use('/',express.static(__dirname+'/web'))
app.use('/admin',express.static(__dirname+'/admin'))
app.use('/uploads',express.static(__dirname+'/uploads'))
require('./plugins/db')(app)
require('./routes/admin')(app)
require('./routes/web')(app)

